<div id="tab-sale-3" class="tab-pane">
    <div class='form-group-title'>积分抵扣</div>
    <div class="form-group">
        <label class="col-sm-2 control-label">
            积分抵扣
        </label>
        <div class="col-sm-9 col-xs-12">
            {ife 'groups.goods' $item}
            <div class='input-group'>
                <span class="input-group-addon">最多抵扣</span>
                <input type="text" name="deduct" value="{$item['deduct']}" class="form-control"/>
                <span class="input-group-addon">元</span>
            </div>
            <span class="help-block">如果设置0，则不支持积分抵扣</span>
            {else}
            <div class='form-control-static'>{$item['deduct']} 元</div>
            {/if}
        </div>
    </div>
    <div class='form-group-title'>
        团长优惠
        {ife 'groups.goods' $item}
        <div class="pull-right" style="text-align: right;padding-right: 28px;">
            是否单独设置团长优惠 <input class="js-switch small" id="discount" name="discount" value="{$item['discount']}" type="checkbox" {if !empty($item['discount'])}checked{/if}/>
        </div>
        {/if}
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">
            {ife 'groups.goods.edit' $item}
            <input type='radio' value='0' name='headstype' {if $item['headstype']==0}checked{/if} />
            {else}
            {if $item['headstype']==0}
            优惠金额
            {/if}
            {/if}
        </label>
        <div class="col-sm-9 col-xs-12">
            {ife 'groups.goods' $item}
            <div class='input-group'>
                <span class="input-group-addon">优惠金额</span>
                <input type="text" name="headsmoney" value="{$item['headsmoney']}" class="form-control"/>
                <span class="input-group-addon">元</span>
            </div>
            <span class="help-block">团长开团立减金额，如果设置0，则团长没有优惠金额</span>
            {else}
            {if $item['headstype']==0}
            <div class='form-control-static'> {$item['headsmoney']} 元</div>
            {/if}
            {/if}
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">
            {ife 'groups.goods' $item}
            <input type='radio' value='1' name='headstype' {if $item['headstype']==1}checked{/if} />
            {else}
            {if $item['headstype']==1}
            优惠折扣
            {/if}
            {/if}
        </label>
        <div class="col-sm-9 col-xs-12">
            {ife 'groups.goods' $item}
            <div class='input-group'>
                <span class="input-group-addon">优惠折扣</span>
                <input type="text" name="headsdiscount" value="{$item['headsdiscount']}" class="form-control"/>
                <span class="input-group-addon">%</span>
            </div>
            <span class="help-block">折扣为0-100整数，如果设置0，则团长没有优惠折扣</span>
            {else}
            {if $item['headstype']==1}
            <div class='form-control-static'> {$item['headsdiscount']} 元</div>
            {/if}
            {/if}
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">是否显示团长优惠</label>
        <div class="col-xs-12 col-sm-8">
            {ife 'groups.goods' $item}
            <label class="radio radio-inline">
                <input type="radio" name="isdiscount" value="1" {if intval($item['isdiscount']) ==1 }checked="checked"{/if}> 是
            </label>
            <label class="radio radio-inline">
                <input type="radio" name="isdiscount" value="0" {if intval($item['isdiscount']) ==0}checked="checked"{/if}> 否
            </label>
            {else}
            <div class='form-control-static'>{if intval($item['isdiscount']) ==1 }是{else}否{/if}</div>
            {/if}
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function(){
        $(":checkbox[name='discount']").click(function () {
            if ($(this).prop('checked')) {
                $(this).val(1);
            }else {
                $(this).val(0);
            }
        })
    })
</script>